<template>
  <div class="Share">
    <div class="hedar-box">
      <div><p>成功邀请人数</p><p>近30日分享奖励</p><p>奖励比例</p></div>
      <div><p>0</p><p>0</p><p>3%</p></div>
    </div>
    <ul class="tal_model">
      <li @click="get_tal(1)" :class="{'activ1':index==1}">分享链接</li>
      <li @click="get_tal(2)" :class="{'activ2':index==2}">分享奖励</li>
      <li @click="get_tal(3)" :class="{'activ2':index==3}">团队详情</li>
      <p class="p1"></p>
      <p class="p2"></p>
    </ul>
    <div class="cent-box">
      <div class="link-box" v-if="index==1">
        <p class="title">推广链接</p>
        <div class="input-box">
          <p>{{link}}</p>
          <input  ref="link" :value="link" readonly />
          <div @click="toCopylink()">复制</div>
        </div>
        <p class="title">我的邀请码</p>
        <div class="input-box">
          <p>{{code}}</p>
          <input ref="code" :value="code" readonly />
          <div  @click="toCopycode()">复制</div>
        </div>
        <p class="title">分享说明</p>
        <div class="flowPath">
          <div><img src="../../assets/flowPath-icon1.png" ><p>分享推广</p></div>
          <div><img src="../../assets/flowPath-icon2.png" ><p>注册充值</p></div>
          <div><img src="../../assets/flowPath-icon3.png" ><p>获得奖励</p></div>
        </div>
        <div class="tips">
          <p>通过您的推广链接或邀请码注册的新用户即成为您的团队。</p>
          <p>团队用户每次充值您都可获得奖励,奖励=充值X3%</p>
        </div>
      </div>
      <div class="reward-box" v-if="index==2">
        <div class="reward-hedar">
          <p>时间</p>
          <p>充值人数</p>
          <p>充值金额</p>
          <p>奖励</p>
          <p>奖励状态</p>
        </div>
        <ul class="reward-cent">
          <li v-for="(item,index) in rewardList">
            <p>xxxxxxxxxxxx</p>
            <p>xxxxxxxxxxxx</p>
            <p>xxxxxxxxxxxx</p>
            <p>xxxxxxxxxxxx</p>
            <p>xxxxxxxxxxxx</p>
          </li>

        </ul>
      </div>
      <div class="team-box" v-if="index==3">
        <div class="team-hedar">
            <div>
              <div class="Single_choice" @click="open_sort()">
               <p>{{sort}}</p>
               <div :class="{'an-activ':sortlist==1}">></div>
              </div>
              <transition name="fade">
                <ul class="list_ul" v-if="sortlist==1">
                  <li @click="Select_sort(0,'全部')">全部</li>
                  <li @click="Select_sort(1,'今日')">今日</li>
                  <li @click="Select_sort(2,'昨日')">昨日</li>
                  <li @click="Select_sort(3,'昨日')">昨日</li>
                  <li @click="Select_sort(4,'近7日')">近7日</li>
                  <li @click="Select_sort(5,'近30日')">近30日</li>
                </ul>
              </transition>
            </div>
            <div class="input-id-box">
              <input type="" name="" v-model="gameid" id="" value="" placeholder="请输入玩家ID"/>
              <div @click="get_gameid()">查询</div>
            </div>
        </div>
        <div class="team-cent">
          <div>
            <p>玩家账号</p><p>充值金额</p><p>奖励金额</p><p>奖励状态</p>
          </div>
          <ul class="team-list">
            <li v-for="(item ,index ) in teamList">
              <p>xxxxxxxxxxxxxx</p>
              <p>xxxxxxxxxxxxxx</p>
              <p>xxxxxxxxxxxxxx</p>
              <p>xxxxxxxxxxxxxx</p>
            </li>
            <li>
              <p>xxxxx</p>
              <p>fffffffffff</p>
              <p>eeeeee</p>
              <p>hhhhhhhh</p>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
 data () {
    return {
      index:1,
      sort:'请选择时间',
      sortlist:0,
      link:'4545646',
      code:'RGS55555',
      rewardList:[1,1,1,1,1,1,1,1,1,1,1],
      teamList:[1,1,1,1,1,1,1,1,1],
      gameid:null,
    }
  },
  methods: {
    get_gameid(){
      console.log(this.gameid)
    },
    get_tal(e){
      this.index = e;
       this.sortlist = 0;
    },
    open_sort(){
      this.sortlist==0?this.sortlist=1:this.sortlist=0;
    },
    Select_sort(e,k){
      this.sort = k
      this.sortlist = 0;
      this.sorts = e;
      this.total = 0;
      this.pageNum = 1;
      this.get_rewardList();
    },
    get_rewardList(){
      console.log('获取数据')
    },
     //复制内容到粘贴板
    toCopylink(e) {
        let copyText = this.$refs.link;
        copyText.select(); // 选择对象
        document.execCommand("Copy");
        this.$confirm({
            time:'1',
            msg:'复制成功！',
        })
    },
    toCopycode(e) {
        let copyText = this.$refs.code;
        copyText.select(); // 选择对象
        document.execCommand("Copy");
        this.$confirm({
            time:'1',
            msg:'复制成功！',
        })
    },
  },
  created() {
    var token = window.localStorage.getItem('token');
    if(!token){
      this.$router.push({
        path: `/Homes`,
      })
    }
  }
}
</script>

<style scoped>
  .fade-enter-active,
  .fade-leave-active {
    transition: all 0.5s;
      max-height: 240px;
  }
  .fade-enter,
  .fade-leave-active {
     opacity: 0;
      max-height: 0px;
  }
  .Share{
    min-height: 1200px;
    width: 100%;
    padding: 53px 90px;
    box-sizing: border-box;
  }
  .hedar-box>div{
    display: flex;
  }
  .hedar-box>div:first-child{
    border: 1px solid #333333;
  }
  .hedar-box>div:nth-child(2){
    border: 1px solid #333333;
    border-top: none;
  }
  .hedar-box>div>p{
    height: 60px;
    width: 33.3%;
    line-height: 60px;
    font-size: 16px;
    color: #666666;
    border-right: 1px solid #333333;
  }
  .hedar-box>div>p:last-child{
    border-right: none;
  }
  .hedar-box>div:nth-child(2)>p{
    color: #FFFFFF;
  }
  .hedar-box>div:nth-child(2)>p:nth-child(2){
    color: #FFA22A;
  }
  .hedar-box>div:nth-child(2)>p:nth-child(3){
    color: #34E527;
  }
   .tal_model{
    display: flex;
    font-size: 18px;
    color: #999999;
    width: 607px;
    background-color: #222833;
    overflow: hidden;
    position: relative;
    margin-top: 25px;
  }
   .tal_model>.p1{
    position: absolute;
    top: -10px;
    left: 207px;
    width: 10px;
    bottom: -10px;
    background-color: #0f141c;
    transform: rotate(31deg);
    z-index: 9;
  }
  .tal_model>.p2{
    position: absolute;
    top: -10px;
    left: 397px;
    width: 10px;
    bottom: -10px;
    background-color: #0f141c;
    transform: rotate(31deg);
    z-index: 9;
  }
   .tal_model::before{
    position: absolute;
    top: -20px;
    right: -15px;
    bottom: -20px;
    content: "";
    width: 30px;
    background-color: #11161f;
    transform: rotate(31deg);
    z-index: 1;
  }
   .tal_model li{
    height: 49px;
    line-height: 49px;
    background-size: 100% 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all .5s;
  }
   .tal_model li:first-child{
    width: 220px;
    height: 49px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-size: 100% 100%;
    background-repeat:no-repeat;
    background-position: -220px 0;
    z-index: 9;
    background-image: url(../../assets/bk-tal1-bgs.png);
    transition: all .5s;
  }
  .tal_model li:nth-child(2){
    width: 221px;
    margin-left: -29px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-size: 100% 100%;
    background-repeat:no-repeat;
    background-position: -221px 0;
    background-image: url(../../assets/bk-tal2-bgs.png);
    transition: all .5s;
    z-index: 8;
  }
 .tal_model li:nth-child(3){
    width: 221px;
    margin-left: -29px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-size: 100% 100%;
    background-repeat:no-repeat;
    background-position: -221px 0;
    background-image: url(../../assets/bk-tal2-bgs.png);
    transition: all .5s;
  }
  .tal_model .activ1{
     background-image: url(../../assets/bk-tal2-bgs.png);
     background-size: 100% 100%;
     height: 49px;
     color: #333333;
     background-position: 0px 0 !important;
  }
   .tal_model .activ2{
    background-image: url(../../assets/bk-tal1-bgs.png) ;
    width: 220px;
    height: 49px;
    background-size: 100% 100%;
    color: #333333;
    background-position: 0px 0 !important;
  }
  .tal_model .activ1::after{
    display: none;
  }
  .tal_model .activ2::after{
    display: none;
  }
  .tal_model li:hover{
    color: #333333;
    background-image: url(../../assets/bk-tal2-bgs.png);
    background-size: 100% 100%;
    transition: all .5s;
    background-position: 0px 0;
  }
  .tal_model li:first-child:hover{
    color: #333333;
    background-image: url(../../assets/bk-tal1-bgs.png);
    background-size: 100% 100%;
    transition: all .5s;
    background-position: 0px 0;
  }
  .tal_model li:hover::after{
    display: none;
  }
  .tal_model li::after{
    position: absolute;
    top: -20px;
    right: 19px;
    bottom: -20px;
    content: "";
    width: 40px;
    background-color: #222833;
    transform: rotate(31deg);
  }
  .tal_model li:not(:first-child)::before{
    position: absolute;
    top: -20px;
    left: -19px;
    bottom: -20px;
    content: "";
    width: 40px;
    background-color: #222833;
    transform: rotate(31deg);
  }
  .cent-box{
    width: 100%;
  }
  .cent-box .link-box{
    padding: 30px 0;
  }
  .cent-box .link-box .title{
    font-size: 22px;
    text-align: left;
    color: #FFFFFF;
  }
  .cent-box .link-box .input-box{
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    margin-bottom: 50px;
    position: relative;
  }
  .cent-box .link-box .input-box input{
    width: 642px;
    padding: 16px 15px;
    font-size: 18px;
    color: #666666;
    background-color: #282B34;
    border: none;
    outline: none;
    box-sizing: border-box;
    padding-left: 15px;
    opacity: 0;
  }
  .cent-box .link-box .input-box>p{
    position: absolute;
    top: 0;
    left: 0;
    height: 53px;
    line-height: 53px;
    width: 642px;
    font-size: 18px;
    color: #666666;
    background-color: #282B34;
    box-sizing: border-box;
    padding-left: 15px;
    z-index: 1;
    text-align: left;
  }
  .cent-box .link-box .input-box div{
    width: 172px;
    height: 53px;
    line-height: 53px;
    background-color: #FFA22A;
    font-size: 18px;
    cursor: pointer;
  }
  .cent-box .flowPath{
    display: flex;
    margin-top: 25px;
  }
  .cent-box .flowPath>div{
    width: 190px;
    height: 132px;
    border: 1px solid #333333;
    margin-right: 28px;
  }
  .cent-box .flowPath>div img{
    margin: 27px auto 0;
  }
  .cent-box .flowPath>div p{
    color: #999999;
    font-size: 16px;
    margin-top: 12px;
  }
  .cent-box .tips{
    margin-top: 24px;
    color: #1D71AD;
    font-size: 14px;
    text-align: left;
  }
  .cent-box .tips p{
    margin-bottom: 5px;
  }
  .cent-box .reward-box{
    width: 100%;
    margin-top: 18px;
  }
  .cent-box .reward-box .reward-hedar{
    display: flex;
    border: 1px solid #333333;
  }
  .cent-box .reward-box .reward-hedar p{
    width: 20%;
    height: 58px;
    line-height: 58px;
    color: #666666;
    font-size: 16px;
  }
  .cent-box .reward-box .reward-cent{
    border: 1px solid #333333;
    border-top: none;
    min-height: 700px;
  }
  .cent-box .reward-box .reward-cent li{
    display: flex;
    width: 100%;
    border-bottom: 1px solid #333333;
  }
  .cent-box .reward-box .reward-cent li:last-child{
    margin-bottom: 30px;
  }
  .cent-box .reward-box .reward-cent li p{
    width: 20%;
    height: 58px;
    line-height: 58px;
    color: #999;
    font-size: 16px;
  }
  .cent-box .team-box{
    width: 100%;
    margin-top: 34px;
  }
  .cent-box .team-box .team-hedar{
    display: flex;
    justify-content: space-between;
  }
  .cent-box .team-box .team-hedar>div{
    position: relative;
  }
  .Single_choice>div{
    transform: rotate(90deg);
    font-size: 18px;
    transition: all .3s;
    color: #999999;
  }
  .Single_choice .an-activ{
    transform: rotate(270deg) !important;
    transition:all .3s;
  }
  .Single_choice>p{
    padding-left: 15px;
    overflow: hidden;/*超出部分隐藏*/
    white-space: nowrap;/*不换行*/
    text-overflow:ellipsis;/*超出部分文字以...显示*/
    color: #D9D9D9;
  }
  .Single_choice{
    width: 160px;
    height: 34px;
    border: 1px solid #333333;
    margin-right: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    justify-content: space-between;
    padding-right: 5px;
    box-sizing: border-box;
    line-height: 34px;
  }
  .list_ul{
    position: absolute;
    left: 0;
    width: 160px;
    top: 40px;
    background-color: #000000;
    color: #FFFFFF;
    overflow: hidden;
    z-index: 9;
  }
  .list_ul li{
    height: 40px;
    line-height: 40px;
    padding: 0 10px;
    text-align: left;
    cursor: pointer;
  }
  .list_ul li:hover{
    background-color: #85B8FA;
  }
  .input-id-box{
    display: flex;
  }
  .input-id-box input{
    width: 200px;
    height: 34px;
    line-height: 34px;
    font-size: 16px;
    color: #D9D9D9;
    padding-left: 15px;
    background-color: rgba(0,0,0,.1);
    border: 1px solid #333333;
    outline: none;
    padding-right: 15px;
  }
  .input-id-box div{
    width: 92px;
    height: 35px;
    line-height: 35px;
    background-color: #0270A2;
    color: #FFFFFF;
    cursor: pointer;
  }
  .team-cent{
    margin-top: 13px;
  }
  .team-cent>div:first-child{
    width: 100%;
    height: 59px;
    line-height: 59px;
    border: 1px solid #333333;
    display: flex;
    box-sizing: border-box;
  }
  .team-cent>div:first-child p{
    width: 25%;
    color: #666666;
  }
  .team-list{
    width: 100%;
    border: 1px solid #333333;
    min-height: 700px;
    border-top: none;
    box-sizing: border-box;
  }
  .team-list li{
    height: 59px;
    line-height: 59px;
    display: flex;
    border-bottom: 1px solid #333333;
  }
  .team-list li:last-child{
    margin-bottom: 30px;
  }
  .team-list li p{
    width: 25%;
    font-size: 16px;
    color: #999999;
  }
</style>
